package ru.nstu.isma.core.hsm.exp;

import ru.nstu.isma.core.hsm.HMVariable;
import ru.nstu.isma.core.hsm.pde.HMApproximateVariable;

/**
 * by
 * Bessonov Alex.
 * Date: 04.12.13 Time: 1:51
 */
public class EXPPDEOperand extends EXPOperand {
    private HMApproximateVariable apxVar;

    private Order order = Order.ONE;

    public EXPPDEOperand(HMVariable variable) {
        super(variable);
    }

    public HMApproximateVariable getApxVar() {
        return apxVar;
    }

    public void setApxVar(HMApproximateVariable apxVar) {
        this.apxVar = apxVar;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public enum Order {
        ONE, TWO
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder(getVariable().getCode());
        sb.append(" BY ");
        sb.append(getApxVar().getCode());
        sb.append(" ON ");
        sb.append(order.name());
        return sb.toString();
    }
}
